package cn.brilliantfuture.commentry.entity;

// Generated 2013-6-13 16:05:20 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * ReservePlan generated by hbm2java
 */
@Entity
@Table(name = "reserve_plan", catalog = "cabinet")
public class ReservePlan implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer reservePlanId;
	private Lockers lockers;
	private StorageGrid storageGrid;
	private Integer serviceType;
	private	String storeCode;
	private Integer reserveType;
	private Integer storeType;
	private Integer gridType;
	private boolean publish;
	private boolean used;
	private Date reserveTime;
	private Date unreserveTime;
	private Date startTime;
	private Date endTime;

	public ReservePlan() {
	}

	public ReservePlan(Lockers lockers, StorageGrid storageGrid, Date startTime,
			Date endTime) {
		this.lockers = lockers;
		this.storageGrid = storageGrid;
		this.startTime = startTime;
		this.endTime = endTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "reserve_plan_id", unique = true, nullable = false)
	public Integer getReservePlanId() {
		return this.reservePlanId;
	}

	public void setReservePlanId(Integer reservePlanId) {
		this.reservePlanId = reservePlanId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_time", nullable = false, length = 19)
	@NotNull
	public Date getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_time", nullable = false, length = 19)
	@NotNull
	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "lockers_id", nullable = false)
	@NotNull
	public Lockers getLockers() {
		return lockers;
	}

	public void setLockers(Lockers lockers) {
		this.lockers = lockers;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storage_grid_id", nullable = false)
	@NotNull
	public StorageGrid getStorageGrid() {
		return storageGrid;
	}

	public void setStorageGrid(StorageGrid storageGrid) {
		this.storageGrid = storageGrid;
	}

	@Column(name = "reserve_type", nullable = false)
	public Integer getReserveType() {
		return reserveType;
	}

	public void setReserveType(Integer reserveType) {
		this.reserveType = reserveType;
	}

	@Column(name = "store_type", nullable = false)
	public Integer getStoreType() {
		return storeType;
	}

	public void setStoreType(Integer storeType) {
		this.storeType = storeType;
	}

	@Column(name = "grid_type", nullable = false)
	public Integer getGridType() {
		return gridType;
	}

	public void setGridType(Integer gridType) {
		this.gridType = gridType;
	}

	@Column(name = "publish", nullable = false)
	public boolean isPublish() {
		return publish;
	}

	public void setPublish(boolean publish) {
		this.publish = publish;
	}

	@Column(name = "used", nullable = false)
	public boolean isUsed() {
		return used;
	}

	public void setUsed(boolean used) {
		this.used = used;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "reserve_time", length = 19, nullable = false)
	public Date getReserveTime() {
		return reserveTime;
	}

	public void setReserveTime(Date reserveTime) {
		this.reserveTime = reserveTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "unreserve_time", length = 19)
	public Date getUnreserveTime() {
		return unreserveTime;
	}

	public void setUnreserveTime(Date unreserveTime) {
		this.unreserveTime = unreserveTime;
	}

	@Column(name = "service_type", nullable = false)
	public Integer getServiceType() {
		return serviceType;
	}

	public void setServiceType(Integer serviceType) {
		this.serviceType = serviceType;
	}

	@Column(name = "store_code", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getStoreCode() {
		return storeCode;
	}

	public void setStoreCode(String storeCode) {
		this.storeCode = storeCode;
	}
}
